<div class="article" data-articleId="<?php echo $this->article->articleId;?>">
    <?php if($this->article->status):?>

    <div class="article-head clearfix">
        <?php if(isset($this->showHead) && $this->showHead):?>
        <span class="author">
            <?php 
            echo $this->partial('script_nickname.phtml', array(
                    'author'    => $this->article->author,
            ));            
            ?>
        </span>
        <hr>
        <?php endif;?>
    </div>

    <div class="article-body clearfix">
        <?php if(isset($this->article->title) && !empty($this->article->title)){?>
        <div class="title">
            <a href="<?php echo $this->article->url->view;?>"><?php echo $this->article->title;?></a>
        </div>
        <?php }?>

        <?php if(isset($this->article->attachments) && is_array($this->article->attachments) && !empty($this->article->attachments)):?>
        <div class="attachments">
            <?php foreach($this->article->attachments as $key=>$attachment):?>
            <div class="attachment clearfix">
                <?php if(isset($attachment->type)){?>
                <?php if($attachment->type == 'music'){?>
                <div class="attachment-music clearfix">
                    <div class="photo"><img src="<?php echo $attachment->data->music->photo->thumb?>" alt="<?php echo $attachment->data->title;?>" title="<?php echo $attachment->data->title;?>" /></div>
                    <div class="player"><embed src="<?php echo $attachment->data->music->flash?>" type="application/x-shockwave-flash" width="257" height="33" wmode="transparent"></embed></div>
                    <div class="title"><?php echo $attachment->data->title;?></div>
                    <div class="description"><?php echo $attachment->data->description?></div>
                </div>
                <?php }elseif($attachment->type == 'video'){?>
                <div class="attachment-video clearfix">
                    <input type="hidden" name="flash" value="<?php echo $attachment->data->video->flash;?>" />
                    <div class="flash ui-widget-content ui-corner-all">
                        <div class="player"></div>
                        <div class="bottom clearfix">
                            <span class="link"><?php echo $attachment->data->video->siteName;?>: <a href="<?php echo $attachment->data->video->siteViewUrl;?>" target="_blank"><?php echo $attachment->data->title;?></a></span>
                            <span class="close"><a><?php echo $this->translate('Close');?></a></span>
                        </div>
                    </div>
                    <div class="photo"><div><img src="<?php echo $attachment->data->video->photo->thumb;?>" alt="<?php echo $attachment->data->title;?>" title="<?php echo $attachment->data->title;?>" /><em></em></div></div>
                    <div class="title"><?php echo $attachment->data->title;?></div>
                    <div class="description"><?php echo $attachment->data->description;?></div>
                </div>
                <?php }elseif($attachment->type == 'image'){?>
                <div class="attachment-image clearfix">
                    <div class="big-image"><img src="<?php echo $attachment->data->photo->middle;?>" /></div>
                    <div class="photo"><div><img src="<?php echo $attachment->data->photo->thumb;?>" alt="<?php echo $attachment->data->title;?>" title="<?php echo $attachment->data->title;?>" /><em></em></div></div>
                    <div class="title"><?php echo $attachment->data->title;?></div>
                    <div class="description"><?php echo $attachment->data->description;?></div>            
                </div>
                <?php }elseif($attachment->type == 'shopping'){?>
                <div class="attachment-shopping clearfix">
                    <div class="big-image"><img src="<?php echo $attachment->data->shopping->photo->middle;?>" /></div>
                    <div class="photo"><div><img src="<?php echo $attachment->data->shopping->photo->thumb;?>" alt="<?php echo $attachment->data->title;?>" title="<?php echo $attachment->data->title;?>" /><em></em></div></div>
                    <div class="title"><a href="<?php echo $attachment->data->shopping->siteViewUrl;?>" target="_blank"><?php echo $attachment->data->title;?></a></div>
                    <div class="description"><?php echo $attachment->data->description;?></div>
                </div>
                <?php }?>
                <?php }?>
            </div>
            <?php endforeach?>
        </div>
        <?php endif;?>

        <?php if(isset($this->article->description)):?>
        <div class="description"><?php echo $this->article->description;?></div>
        <?php endif;?>

        <?php if(!$this->article->isAll):?>
        <div class="view-all clearfix"><span><a href="<?php echo $this->article->url->view;?>"><?php echo $this->translate('Browse all');?>...</a></span></div>
        <?php endif;?>

        <?php if(isset($this->article->tags)):?>
        <div class="tags">
            <span class="dataname"><?php echo $this->translate('Tags');?>：</span>
            <?php if(is_array($this->article->tags)):?>
            <?php foreach($this->article->tags as $key=>$tag):?>
            <span class="tag"><a href="<?php echo $tag->url;?>"><?php echo $tag->name;?></a></span>
            <?php endforeach;?>
            <?php endif;?>
        </div>
        <?php endif;?>
    </div>
    <div class="article-foot clearfix">
        <div class="date"><?php echo $this->article->createDate;?></div>
        <div class="action">
            <span><a href="<?php echo $this->article->url->reply;?>"><?php echo $this->translate('Reply');?>(<?php echo $this->article->replies;?>)</a></span>
        </div>
    </div>
    <div class="article-access clearfix">
        <?php if($this->article->access->delete):?>
        <span class="delete" data-deleteArticleId="<?php echo $this->article->articleId;?>"><a href="javascript:void 0;"><?php echo $this->translate("Delete");?></a>
        </span>
        <?php endif;?>

        <?php if($this->article->access->edit):?>
        <span><a href="<?php echo $this->article->url->edit;?>"><?php echo $this->translate("Edit");?></a></span>
        <?php endif;?>
    </div>

    <?php if($this->article->family):?>
    <div class="article-family clearfix">
        <?php
            echo $this->partial('script_article-family.phtml', array(
                'family'   => $this->article->family,
            ));
        ?>
    </div>
    <?php endif;?>
<?php else:?>
    <span class="ui-icon ui-icon-notice column"></span><?php echo $this->translate("The blog`s article record not found.");?>
<?php endif;?>
</div>
